'''
13
3520 0 3 89 56 88 3521 9 90 1 99 2 87
'''
# 1.输入一组整数，并将其存入数组 nums
n = int(input())
nums_str = input().split(' ')
# print(nums_str)
nums = []
for i in nums_str:
    nums.append(int(i))

nums = sorted(nums)
# for i in nums:
#     print(i,end=' ')
lens = []
res = []
max_len = 0

i = 0
while (i < len(nums)):
    j = i + 1
    while (j < len(nums)):
        if nums[j] - 1 == nums[j - 1]:
            j += 1
        else:
            break
    if j - i > 1 and j - i >= max_len:
        max_len = j - i
        lens.append(j - i)
        t = []
        for k in range(i, j):
            t.append(nums[k])
        res.append(t)
    i = j

print(max_len)
for ns in res:
    for j in ns:
        print(j, end=' ')
    print()

